<template>
  <div>
    <p @click="showDialog">查看公告</p>
    <el-dialog v-model="isShowDialog" title="施工公告信息">
      <div>
        <div id="time">
          <span style="font-weight: bold;">公告发布时间:</span>
           {{ lssueTime[lssueTime.length - 1] }}
        </div>
        <div id="text" style="white-space: pre-wrap; word-wrap: break-word;">
          <span style="font-weight: bold;">公告发布内容：</span>
          <span>{{ textContent[textContent.length - 1] }}</span>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script setup>
//控制dialog的显隐
let isShowDialog = ref(false)
function showDialog() {
  isShowDialog.value = !isShowDialog.value
  console.log(isShowDialog.value)
}
//引入pinia仓库
import { usePiniaStore } from '../../../../stores/pinia'
import { storeToRefs } from 'pinia';
const piniaStore = usePiniaStore()
const { lssueTime } = storeToRefs(piniaStore)
const { textContent } = storeToRefs(piniaStore)
</script>

<style scoped>

</style>